import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/font_weight.dart';
import 'package:flutter_eve_plugin/model/ye_xiu/achieves/archieves_weapon_entity.dart';
import 'package:flutter_eve_plugin/utils/image_util.dart';
import 'package:flutter_eve_plugin/utils/print_util.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

class ArchivesFooterWidget extends StatelessWidget {
  // ignore: non_constant_identifier_names
  final ArchievesWeaponEntity weaponEntity;

  const ArchivesFooterWidget({
    Key key,this.weaponEntity
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    logPrint('ArchievesWeaponEntity build');
    return Container(
      width: setRatio(360),
      height: setRatio(95),
      margin: EdgeInsets.only(left: setRatio(7.5), top: setRatio(9)),
      decoration: BoxDecoration(
          image: DecorationImage(
              image: AssetImage(
                  imageUtilYeXiu('archives/icon_archivers_footer_bg@3x')))),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Padding(
            padding: EdgeInsets.only(left: setRatio(28)),
            child: Stack(
              children: <Widget>[
                Container(
                  width: setRatio(50),
                  height: setRatio(50),
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(setRatio(5)),
                      image: DecorationImage(
                          image: NetworkImage(
                              '${weaponEntity?.currentForm?.picUrl ?? '' }'))),
                ),
               /* Positioned(
                  bottom: 0,
                  child: Container(
                    height: setRatio(13),
                    width: setRatio(50),
                    decoration: BoxDecoration(
                        color: Color(0x9F000000),PluginEve.sendMessage(
                        borderRadius: BorderRadius.only(
                            bottomLeft: Radius.circular(setRatio(2)),
                            bottomRight: Radius.circular(setRatio(2)))),
                    child: Center(
                      child: Text(
                        '54/30',
                        style: TextStyle(
                            decoration: TextDecoration.none,
                            color: Color(0xFFFFFFFF),
                            fontFamily: FontFamily.PINGFANG,
                            fontWeight: FontWeightCustom.PF_Medium,
                            fontSize: setTextSp(9)),
                      ),
                    ),
                  ),
                )*/
              ],
            ),
          ),
          SizedBox(
            width: setRatio(6),
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Row(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  Text(
                    '武器',
                    style: TextStyle(
                        decoration: TextDecoration.none,
                        fontFamily: FontFamily.PINGFANG,
                        fontWeight: FontWeightCustom.PF_Medium,
                        fontSize: setTextSp(12),
                        color: Color(0xFFEFF0F8)),
                  ),
                  Text.rich(TextSpan(
                      style: TextStyle(
                          decoration: TextDecoration.none,
                          fontFamily: FontFamily.PMZD,
                          fontSize: setTextSp(15),
                          color: Color(0xFFFFFFFF)),
                      children: [
                        TextSpan(text: ' 千机伞'),
                        TextSpan(
                            text: ' Lv.${weaponEntity.weaponLevel}',
                            style: TextStyle(fontSize: setTextSp(12))),
                      ]))
                ],
              ),
              SizedBox(
                height: setRatio(4),
              ),
              Text.rich(TextSpan(
                  style: TextStyle(
                      decoration: TextDecoration.none,
                      fontFamily: FontFamily.PINGFANG,
                      fontWeight: FontWeightCustom.PF_Medium,
                      fontSize: setTextSp(10),
                      color: Color(0xFFEFF0F8)),
                  children: [
                    TextSpan(text: '解锁进阶形态：'),
                    TextSpan(
                        text: '${(weaponEntity?.currentForm?.formLevel == -1 ? weaponEntity?.maxFormLevel : weaponEntity?.currentForm?.formLevel) ?? 0}'
                            ' / ${weaponEntity?.maxFormLevel ?? 0}',
                        style: TextStyle(
                            fontSize: setTextSp(11), color: Color(0xFFFFBF13))),
                  ]))
            ],
          ),
          Expanded(
            child: Container(),
          ),
          Image.asset(
            imageUtilYeXiu('archives/icon_archivers_footer_more@3x'),
            width: setRatio(12),
            height: setRatio(20),
          ),
          SizedBox(
            width: setRatio(28),
          )
        ],
      ),
    );
  }
}
